<%@page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page import="com.model.User"%>

<%@taglib prefix="s" uri="/struts-tags" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/backPage/";	

	User user = (User) session.getAttribute("userInfo");
	if (user == null || !user.getState().equals("teacher"))
		response.sendRedirect("login.jsp");

%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
	<head>
		<base href="<%=basePath%>" />
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta http-equiv="pragma" content="no-cache" />
		<meta http-equiv="cache-control" content="no-cache" />
		<meta http-equiv="expires" content="0" />
		<meta http-equiv="keywords" content="" />
		<meta http-equiv="description"
			content="Teacher's entry for Software Engineering Course" />
		<title>Teacher's entry for Software Engineering Course</title>
		<link rel="stylesheet" type="text/css" href="css/backpage.css" />
		<script type="text/javascript" src="js/default.js"></script>
		<script type="text/javascript">
		<!--
			function change(){
				var flag = document.getElementById("flag");
				var tA = document.getElementById("tA");
				var tB = document.getElementById("tB");
				var tC = document.getElementById("tC");
				var tD = document.getElementById("tD");
				var answer = document.getElementById("answer");
				var ans = document.getElementById("ans");
				var answerA = document.getElementById("answerA");
				var answerB = document.getElementById("answerB");
				var answerC=document.createElement("option");
				answerC.setAttribute("value","C");
				answerC.innerHTML="C";
				var answerD=document.createElement("option");
				answerD.setAttribute("value","D");
				answerD.innerHTML="D";
				if (flag.value == 1) {
					tA.style.display = "table-row";
					tB.style.display = "table-row";
					tC.style.display = "table-row";
					tD.style.display = "table-row";
					answer.innerHTML = "正确选项";
					answerA.innerHTML = "A";
					answerA.value = "A";
					answerB.innerHTML = "B";
					answerB.value = "B";
					ans.appendChild(answerC);
					ans.appendChild(answerD);
					
				} else {
					tA.style.display = "none";
					tB.style.display = "none";
					tC.style.display = "none";
					tD.style.display = "none";
					answer.innerHTML = "正确答案";
					answerA.innerHTML = "对";
					answerA.value = "对";
					answerB.innerHTML = "错";
					answerB.value = "错";
					ans.remove(2);
					ans.remove(2);
				}
			}
		//-->
		</script>
	</head>

	<body onload="change();">

		<div id="Header">

			<div id="Logon">
				<div id="Logon">
					<form action="">
						<table>
							<tr>
								<td>
									欢迎您
									<s:property value="#session.userInfo.getName()" />
								</td>
								<td class="seperator"></td>
								<td>
									<a href="../backlogin!logout.action">退出</a>
								</td>
							</tr>
						</table>
					</form>
				</div>
			</div>

			<div id = "Logo">
				<img src="<%=basePath%>img/logo.png" alt="南开大学" />
			</div>
		
			<div id="Navigation">
				<table>
					<tr>
						<td id="nav_doc">
							<a href="?resType=doc" style="font-family: '微软雅黑';">教学课件</a>
						</td>
						<td id="nav_video">
							<a href="?resType=video" style="font-family: '微软雅黑';">教学视频</a>
						</td>
						<td id="nav_software">
							<a href="?resType=software" style="font-family: '微软雅黑';">教学软件</a>
						</td>
						<td id="nav_reference">
							<a href="?resType=reference" style="font-family: '微软雅黑';">参考资料</a>
						</td>
						<td id="nav_notice">
							<a href="../notices!showNotices.action" style="font-family: '微软雅黑';">课程通知</a>
						</td>
						<td id="nav_exam">
							<a href="jsp/addexam.jsp" style="font-family: '微软雅黑';">题目管理</a>
						</td>
					</tr>
				</table>
				<script type="text/javascript">
	navClicked("exam");
</script>
			</div>
		</div>

		<div id="MainContent">

			<div id="TopLine"></div>

			<table>
				<tr>

					<td valign="top" class="content_left">
						<div id="Menu">
							<div id="MenuTop"></div>
							<div id="MenuMid">

								<div id="MenuUnit" class="search">
								  <ul>
									<li>
										检索字段
										<input id="keyWord" name="keyWord" type="text" />
									</li>
									<li>
										字段类型
										<select id="wordType" name="wordType" disabled="disabled">
											<option value="all">
												所有
											</option>
										</select>
									</li>
									<li>
										检索范围
										<select id="searchScope" name="searchScope" disabled="disabled">
											<option value="<%=request.getParameter("resType")%>">
												当前选项卡
											</option>
										</select>
									</li>
									<li class="center">
										<input type="button" value="检索" disabled="disabled" />
									</li>
								  </ul>
								</div>

								<div id="MenuUnit" class="catalogue">
									<ul><li>
										<a href="">默认归档</a>
									</li></ul>
								</div>
							</div>
							<div id="MenuBottom"></div>
						</div>
					</td>

					<td valign="top" class="content_right">

						<div>
							<s:form action="exam!addExam.action" namespace="/">
								<table id="tab">
									<tr>
										<td>
											题 型
										</td>
										<td>
											<select name="flag" id="flag" onchange="change();">
												<option value="1">
													选择题
												</option>
												<option value="0">
													判断题
												</option>
											</select>
										</td>
									</tr>
									<tr>
										<td>
											题 干
										</td>
										<td>
											<input type="text" name="question" size="100" />
										</td>
									</tr>
									<tr id="tA">
										<td>
											选项A
										</td>
										<td>
											<input type="text" name="optionA" size="35" />
										</td>
									</tr>
									<tr id="tB">
										<td>
											选项B
										</td>
										<td>
											<input type="text" name="optionB" size="35" />
										</td>
									</tr>
									<tr id="tC">
										<td>
											选项C
										</td>
										<td>
											<input type="text" name="optionC" size="35" />
										</td>
									</tr>
									<tr id="tD">
										<td>
											选项D
										</td>
										<td>
											<input type="text" name="optionD" size="35" />
										</td>
									</tr>
									<tr id="tanswer">
										<td id="answer">
											正确选项
										</td>
										<td>
											<select name="answer" id="ans">
												<option value="A" id="answerA">
													A
												</option>
												<option value="B" id="answerB">
													B
												</option>
											</select>
										</td>
									</tr>

									<tr>
										<td></td>
										<td>
											<input type="submit" value="提交" />
										</td>
									</tr>
								</table>
							</s:form>

						</div>
					</td>
				</tr>
			</table>

			<div id="BottomLine"></div>

		</div>

		<div id="Footer">
			<table width="100%">
				<tr>
					<td>
						<a href="../index.jsp">返回前台</a>
						<s:a action="init.action" namespace="/">论坛学习</s:a>
						<a href="http://www.nankai.edu.cn" target="view_window">南开大学</a>
						<a href="http://cs.nankai.edu.cn" target="view_window">软件学院</a>
						<a href="http://soft.nankai.edu.cn" target="view_window">软件之家</a>
						<a href="http://music.nankai.edu.cn" target="view_window">世外桃源</a>
						<a href="http://movie.nankai.edu.cn" target="view_window">光影传奇</a>
						<a href="http://music.nankai.edu.cn" target="view_window" style="border-right: none;">联系我们</a>
					</td>
				</tr>
				<tr>
					<td>
						<p style="float:left; margin-top: 5px; margin-left: 300px; color: #3a91b8;">版权所有@南开大学软件学院</p>
						<p style="margin-top: 5px; margin-right: 200px; color: #3a91b8;">联系地址：天津市南开区卫津路94号南开大学13宿</p>	
					</td>
				</tr>
		</table>
		</div>

	</body>
</html>